home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / prtcs155.zip / RFSFREQL.REX < prev    next >
OS/2 REXX Batch file  |  1994-01-14  |  8KB  |  219 lines

  1. /**/
  2. v="$VER: RFSfreqList  Rexx WPL Freq List Creator Williamson 54.02"
  3. /*
  4.    Based on Falcon File Manager by Robert Williamson 1:167/104.0
  5.         Originally Modified for Falcon CBCS By Tony Jones (2:255/35)
  6.         from Tim Aston's TransAmiga BBS script, FileUtil.trans
  7.  
  8.       Be sure to change the List command exclusion parameters (EXCLUDE)  
  9.       for those files you want ignored in listings
  10.  
  11.     Config File Format:
  12.     AREA# "PATH" "NAME"
  13. */
  14. call Pragma("P",-1)
  15. debug=0
  16. sort=1
  17. /* LIST exclusion parameters    */
  18. EXCLUDE     =   '~(empty|area.text|files.bbs|LZTEMP.#?|.info)'
  19. /* WB2 List Lformat parameters  */
  20. LFFREQ      =   '"%N %F%N"'                       /* freq.lst         */
  21.  
  22. /*  You must create these files */
  23. bbslist     = "BBS:text/bbsn.list"               /* filearea config  */
  24. mtext       = "CFG:MAGIC.TXT"                    /* FREQ Magic names */
  25.  
  26. /* System description header */
  27. /* This should also contain the list of MAGIC filenames accepted */
  28. htext       = "CFG:filelistheader.txt" 
  29.  
  30. fldir       = "Mail:FILELISTS"                 /* Freqable filelists dir */
  31. /* Note: some Freq makers require that this standard be followed */
  32. all_list     = "01670104.LST"                   /* Normal Level List */
  33. all_arc      = "01670104.LHA"                   /* Archived Normal List */
  34. new_list     = "NEWFILES.LST"                   /* Newfiles list */
  35.  
  36.  
  37. /* output files - edit names to suit */
  38. freqlist     = "MAIL:freq.lst"                  /* filename, full path */
  39.  
  40.  
  41. /* Configuration of Magic File Names for FREQ List              */
  42. /* Standard MAGIC FileNames That Never Change                   */
  43. /* DO NOT change these entries, these are configured above      */
  44. magic.1 = "FILES    > "addslash(fldir)||all_arc     /* configured above */
  45. magic.2 = "NEWFILES > "addslash(fldir)||new_list    /* configured above */
  46. magic.3 = "NEW      > "addslash(fldir)||new_list    /* configured above */
  47. magic.4 = "MAGIC    > "htext                         /* configured above */
  48. magic.5 = "ABOUT    > "htext                         /* configured above */
  49.  
  50. /* add your FIXED MAGIC names here */
  51. magic.6     = "ROOFREXX > bbsf6:ROOF/ROOF_REXX.LHA"
  52. magic.7     = "ROOFDOS  > bbsf6:ROOF/ROOF_DOS.LHA"
  53. magic.8     = "ROOFDOCS > bbsf6:ROOF/ROOF_DOCS.LHA"
  54. magic.9     = "ROOFBIN  > bbsf6:ROOF/ROOF_BIN.LHA"
  55. magic.10    = "ROOFRCP  > bbsf6:ROOF/ROOF_RCP.LHA"
  56. magic.11    = "ROOFWPL  > BBSF6:ROOF/ROOF_WPL.LHA"
  57. magic.12    = "ROOF     > BBSF6:ROOF/ROOF.LHA"
  58. magic.13    = "UMBRELLA > BBSF6:wpl/UMBRELLA.LHA"
  59. magic.14    = "XPACK    > BBSF6:wpl/XPACK.LHA"
  60. magic.15    = "GAZEBO   > BBSF6:wpl/GAZEBO.LHA"
  61. magic.16    = "PORTICUS > BBSF6:wpl/PORTICUS.LHA"
  62. magic.17    = "RFS      > BBSF6:ROOF/RFS.LHA"
  63. magic.18    = "WPLRX    > BBSF6:ROOF/WPLRX.LHA"
  64. magic.19    = "WFREQIT  > BBSF6:ROOF/WFREQIT.LHA"
  65.  
  66. /* FileNames that require updating to the latest version should */
  67. /* use '^' instead of '>'                                       */
  68. magic.20    = "FILEMGR      ^ BBSF6:ROOF/FILEMGR_V??.??.LHA"
  69. magic.21    = "FANSI        ^ BBSF4:G&S/FANSI_V?.?.LHA"
  70. magic.22    = "DEKSID       ^ BBSF6:DUTIL/DEK???.LHA"
  71. magic.23    = "BBSLIST      ^ BBSF5:MTL-BBS/BBS?????.LST"
  72. magics = 23
  73. magic.0 = 23
  74. /* NUMBER of MAGIC NAMES */
  75.  
  76. /* used internally */
  77. freqtemp = "T:FLST-"Pragma('ID')            /* temporary freq list */
  78.  
  79. script  = "RFSfreqList"
  80. ver     = "v"||right(v,5)
  81. lf      = '0a'x
  82. CSI='9b'x;OFF=CSI||'0m';BOLD=CSI||'1m';ULINE=CSI||'4m';ITALICS=CSI||'3;40m'
  83. quote   = '"'
  84.  
  85. fmvers  = BOLD||''script ver||OFF
  86. options results
  87. options failat 20
  88. signal on halt
  89. signal on ioerr
  90. signal on break_c
  91. signal on break_d
  92.  
  93.     call close('STDOUT')
  94.     call open('STDOUT',"RAW:0/10/640/100/"script ver"/CLOSE",'w')
  95.     call close('STDIN')
  96.     call open('STDIN','*','R')
  97.  
  98. if ~show("L", "rexxsupport.library") then
  99.     if ~addlib("rexxsupport.library", 0, -30, 0) then
  100.         do
  101.                 call writeln(STDOUT, "Couldn't access support.library !")
  102.                 exit 20
  103.         end
  104.  
  105.  
  106.     if ~open('dlst',bbslist, 'R') then
  107.     do
  108.         call writeln(STDOUT, "Couldn't open fileareas list !")
  109.         exit 20
  110.     end
  111.     if show('p',"ROOFLOG") then address 'ROOFLOG' 'logline' left(time(),5) script': Updating Freq Listing'
  112.     call writeln(STDOUT, lf||ITALICS||" "fmvers||lf||" by Robert Williamson 1:167/104.0@fidonet"||OFF)
  113.     /* Start Area Processing */
  114.     call writeln(STDOUT, 'Reading file area configuration')
  115.     area = 0
  116.     do while ~eof('dlst')
  117.         call writech(STDOUT,'.')
  118.         blstln=readln('dlst')
  119.         if blstln="" then iterate
  120.         parse var blstln Number.area '"' Path.area '"' '"' Name.area '"'
  121.         area=area+1
  122.     end /*eof*/
  123.  
  124.     areas=area-1
  125.     call writeln(STDOUT,lf||'Found 'areas' file areas')
  126.  
  127.     call writeln(STDOUT, BOLD||"Generating File Request Listing"||OFF||lf)
  128.     if exists(mtext) then address COMMAND 'Copy' mtext freqtemp
  129.     else do
  130.         call open('lstf',freqtemp,'W')      /* create the file */
  131.         call close('lstf')                 /* delete old one  */
  132.     end
  133.     if (magics ~= 0) then
  134.     do
  135.         CR='0a'x
  136.         if ~open('tfl',freqtemp,'A') then
  137.         do
  138.             call writeln(STDOUT, 'Unable to open 'freqtemp)
  139.             exit 10
  140.         end
  141.         call writeln(STDOUT, 'Updating 'magics' Magic names')
  142.         do i=1 to magics
  143.             call writech(STDOUT,'.')
  144.             /*                                                  file/magicname           !password                fullpath */
  145.             if left(word(magic.i,2),1) = '!' then writech('tfl',strip(word(magic.i,1))' 'strip(word(magic.i,2))' 'strip(word(magic.i,3))||CR)
  146.                 else if word(magic.i,2) = '>' then writech('tfl',strip(word(magic.i,1))' 'strip(word(magic.i,3))||CR)
  147.             if word(magic.i,2) = '^' then
  148.             do
  149.                 close('tfl')
  150.                 cmd='List >>'freqtemp word(magic.i,3) LFORMAT '"'word(magic.i,1)' %P%N"'
  151.                 address COMMAND cmd
  152.                 open('tfl',freqtemp,'A')
  153.             end
  154.         end
  155.         call close('tfl')
  156.     end
  157.  
  158.     call writeln(STDOUT, lf||'Processing')
  159.     do area=0 to areas
  160.         if ~debug then call writeln(STDOUT,Path.area)
  161.         else do
  162.             /* Display info on a area */
  163.             call writeln(STDOUT, BOLD||'Area       '||OFF Number.area)
  164.             call writeln(STDOUT, BOLD||'Name       '||OFF Name.area)
  165.             call writeln(STDOUT, BOLD||'Path       '||OFF Path.area)
  166.         end
  167.         if Password.area = "PASSWORD."area | Password.area = "" then 
  168.         do
  169.             if debug then call writeln(STDOUT, BOLD||'Password   '||OFF 'none')
  170.             address COMMAND 'List >>"'freqtemp'"' Path.area||exclude 'FILES NOHEAD LFORMAT='LFFREQ
  171.         end
  172.         else do
  173.             if debug then call writeln(STDOUT, BOLD||'Password   '||OFF Password.area)
  174.             address COMMAND 'List >>"'freqtemp'"' Path.area||exclude 'FILES NOHEAD LFORMAT="%N !'Password.area' %F%N"'
  175.         end
  176.     end
  177.     
  178.     if sort then
  179.     do
  180.         call writeln(STDOUT, BOLD||'Sorting 'freqtemp' to 'freqlist||OFF)
  181.         address COMMAND 'SORT' freqtemp freqlist
  182.     end
  183.     else do
  184.         call writeln(STDOUT, BOLD||'Copying 'freqtemp' to 'freqlist||OFF)
  185.         address COMMAND 'COPY' freqtemp freqlist
  186.     end
  187.     call delete(freqtemp)      
  188.     if exists("RAM:FREQ.LST") then 
  189.     do
  190.         call writeln(STDOUT, BOLD||'Copying 'freqlist' to RAM:'||OFF)
  191.         address COMMAND 'Copy' freqlist "RAM:FREQ.LST"
  192.     end
  193.     call writeln(STDOUT, 'Freq Listing completed')
  194.     if show('p',"ROOFLOG") then address 'ROOFLOG' 'logline' left(time(),5) script': Freq Listing completed'
  195. exit
  196.  
  197. dequote:
  198. parse arg thing
  199. parse var thing '"' unq_thing '"'
  200. if unq_thing ~= "" then return unq_thing
  201. return thing
  202.  
  203. addslash:
  204. curr = arg(1)
  205. select
  206.     when right(curr, 1) = ":" then nop
  207.         when right(curr, 1) = "/" then nop
  208.             otherwise curr = curr"/"
  209. end
  210. return curr
  211.    
  212. halt:
  213. ioerr:
  214. break_c:
  215. break_d:
  216.     call writech(STDOUT,lf)
  217.     exit 10
  218.  
  219.